<template>
  父组件
  <h3>车名：{{ name }}</h3>
  <h3>价格：{{ price }}</h3>
  <hr />
</template>

<script>
import {ref,readonly,reactive, toRefs,isReactive,
  isReadonly,isRef,isProxy} from "vue";
export default {
  name: "App",
  components: { },
  setup() {
    let car = reactive({
      name: "宝马",
      price: 10000000,
    });
    let sum = ref(0);
    let car2 = readonly(car);
    console.log(isRef(sum));
    console.log(isReactive(car));
    console.log(isProxy(car));

    console.log(isReadonly(car2));
    console.log(isProxy(car2));
    console.log(isProxy(sum));

    return { ...toRefs(car) };
  },
};
</script>

<style>
</style>
